Optimal. Leaf size=99 \[ \frac {a^2 (i A+B) c^4 (1-i \tan (e+f x))^4}{2 f}-\frac {a^2 (i A+3 B) c^4 (1-i \tan (e+f x))^5}{5 f}+\frac {a^2 B c^4 (1-i \tan (e+f x))^6}{6 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} -\frac {a^2 c^4 (3 B+i A) (1-i \tan (e+f x))^5}{5 f}+\frac {a^2 c^4 (B+i A) (1-i \tan (e+f x))^4}{2 f}+\frac {a^2 B c^4 (1-i \tan (e+f x))^6}{6 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^4 \, dx &=\frac {(a c) \text {Subst}\left (\int (a+i a x) (A+B x) (c-i c x)^3 \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (2 a (A-i B) (c-i c x)^3-\frac {a (A-3 i B) (c-i c x)^4}{c}-\frac {i a B (c-i c x)^5}{c^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {a^2 (i A+B) c^4 (1-i \tan (e+f x))^4}{2 f}-\frac {a^2 (i A+3 B) c^4 (1-i \tan (e+f x))^5}{5 f}+\frac {a^2 B c^4 (1-i \tan (e+f x))^6}{6 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.44, size = 177, normalized size = 1.79 \begin {gather*} \frac {a^2 c^4 \sec (e) \sec ^6(e+f x) (10 (-3 i A+B) \cos (e)+15 (-i A+B) \cos (e+2 f x)-15 i A \cos (3 e+2 f x)+15 B \cos (3 e+2 f x)-30 A \sin (e)-10 i B \sin (e)+30 A \sin (e+2 f x)-15 A \sin (3 e+2 f x)-15 i B \sin (3 e+2 f x)+18 A \sin (3 e+4 f x)+6 i B \sin (3 e+4 f x)+3 A \sin (5 e+6 f x)+i B \sin (5 e+6 f x))}{120 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 116, normalized size = 1.17
method | result | size |
risch | \(\frac {8 c^{4} a^{2} \left (15 i A \,{\mathrm e}^{4 i \left (f x +e \right )}+15 B \,{\mathrm e}^{4 i \left (f x +e \right )}+18 i A \,{\mathrm e}^{2 i \left (f x +e \right )}-6 B \,{\mathrm e}^{2 i \left (f x +e \right )}+3 i A -B \right )}{15 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{6}}\) | \(83\) |
derivativedivides | \(\frac {c^{4} a^{2} \left (-\frac {B \left (\tan ^{6}\left (f x +e \right )\right )}{6}+\frac {\left (-2 i B -A \right ) \left (\tan ^{5}\left (f x +e \right )\right )}{5}+\frac {\left (i A +3 i \left (i B -A \right )+3 B \right ) \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {2 i B \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {\left (-3 i A -i \left (i B -A \right )\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}+A \tan \left (f x +e \right )\right )}{f}\) | \(116\) |
default | \(\frac {c^{4} a^{2} \left (-\frac {B \left (\tan ^{6}\left (f x +e \right )\right )}{6}+\frac {\left (-2 i B -A \right ) \left (\tan ^{5}\left (f x +e \right )\right )}{5}+\frac {\left (i A +3 i \left (i B -A \right )+3 B \right ) \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {2 i B \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {\left (-3 i A -i \left (i B -A \right )\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}+A \tan \left (f x +e \right )\right )}{f}\) | \(116\) |
norman | \(\frac {A \,a^{2} c^{4} \tan \left (f x +e \right )}{f}-\frac {\left (2 i B \,a^{2} c^{4}+A \,a^{2} c^{4}\right ) \left (\tan ^{5}\left (f x +e \right )\right )}{5 f}+\frac {\left (-2 i A \,a^{2} c^{4}+B \,a^{2} c^{4}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}-\frac {B \,a^{2} c^{4} \left (\tan ^{6}\left (f x +e \right )\right )}{6 f}-\frac {i A \,a^{2} c^{4} \left (\tan ^{4}\left (f x +e \right )\right )}{2 f}-\frac {2 i B \,a^{2} c^{4} \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}\) | \(145\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.53, size = 122, normalized size = 1.23 \begin {gather*} -\frac {5 \, B a^{2} c^{4} \tan \left (f x + e\right )^{6} + 6 \, {\left (A + 2 i \, B\right )} a^{2} c^{4} \tan \left (f x + e\right )^{5} + 15 i \, A a^{2} c^{4} \tan \left (f x + e\right )^{4} + 20 i \, B a^{2} c^{4} \tan \left (f x + e\right )^{3} + 15 \, {\left (2 i \, A - B\right )} a^{2} c^{4} \tan \left (f x + e\right )^{2} - 30 \, A a^{2} c^{4} \tan \left (f x + e\right )}{30 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.61, size = 144, normalized size = 1.45 \begin {gather*} -\frac {8 \, {\left (15 \, {\left (-i \, A - B\right )} a^{2} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} + 6 \, {\left (-3 i \, A + B\right )} a^{2} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-3 i \, A + B\right )} a^{2} c^{4}\right )}}{15 \, {\left (f e^{\left (12 i \, f x + 12 i \, e\right )} + 6 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 15 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 20 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 15 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 6 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 224 vs. \(2 (78) = 156\).
time = 0.62, size = 224, normalized size = 2.26 \begin {gather*} \frac {24 i A a^{2} c^{4} - 8 B a^{2} c^{4} + \left (144 i A a^{2} c^{4} e^{2 i e} - 48 B a^{2} c^{4} e^{2 i e}\right ) e^{2 i f x} + \left (120 i A a^{2} c^{4} e^{4 i e} + 120 B a^{2} c^{4} e^{4 i e}\right ) e^{4 i f x}}{15 f e^{12 i e} e^{12 i f x} + 90 f e^{10 i e} e^{10 i f x} + 225 f e^{8 i e} e^{8 i f x} + 300 f e^{6 i e} e^{6 i f x} + 225 f e^{4 i e} e^{4 i f x} + 90 f e^{2 i e} e^{2 i f x} + 15 f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 177 vs. \(2 (86) = 172\).
time = 1.06, size = 177, normalized size = 1.79 \begin {gather*} -\frac {8 \, {\left (-15 i \, A a^{2} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} - 15 \, B a^{2} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} - 18 i \, A a^{2} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} + 6 \, B a^{2} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} - 3 i \, A a^{2} c^{4} + B a^{2} c^{4}\right )}}{15 \, {\left (f e^{\left (12 i \, f x + 12 i \, e\right )} + 6 \, f e^{\left (10 i \, f x + 10 i \, e\right )} + 15 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 20 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 15 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 6 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.60, size = 120, normalized size = 1.21 \begin {gather*} -\frac {\frac {a^2\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (-B+A\,2{}\mathrm {i}\right )}{2}-A\,a^2\,c^4\,\mathrm {tan}\left (e+f\,x\right )+\frac {a^2\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^5\,\left (A+B\,2{}\mathrm {i}\right )}{5}+\frac {B\,a^2\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^6}{6}+\frac {A\,a^2\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^4\,1{}\mathrm {i}}{2}+\frac {B\,a^2\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^3\,2{}\mathrm {i}}{3}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________